﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>AClientNetwork 类
 | Fantasy.Net API Reference </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="AClientNetwork 类
 | Fantasy.Net API Reference ">
      
      <link rel="icon" href="../favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
  </head>

  <script type="module">
    import options from './../public/main.js'
    import { init } from './../public/docfx.min.js'
    init(options)
  </script>

  <script>
    const theme = localStorage.getItem('theme') || 'auto'
    document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
  </script>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../logo.svg" alt="Fantasy.Net">
            Fantasy.Net
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled="" placeholder="搜索" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Fantasy.Core.Network.AClientNetwork">



  <h1 id="Fantasy_Core_Network_AClientNetwork" data-uid="Fantasy.Core.Network.AClientNetwork" class="text-break">
    AClientNetwork 类
  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>命名空间</dt><dd><a class="xref" href="Fantasy.html">Fantasy</a>.<a class="xref" href="Fantasy.Core.html">Core</a>.<a class="xref" href="Fantasy.Core.Network.html">Network</a></dd></dl>
  <dl><dt>程序集</dt><dd>Fantasy.Net.dll</dd></dl>
  </div>

  <div class="markdown summary"></div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract class AClientNetwork : ANetwork, IDisposable</code></pre>
  </div>




  <dl class="typelist inheritance">
    <dt>继承</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><a class="xref" href="Fantasy.Core.Network.ANetwork.html">ANetwork</a></div>
      <div><span class="xref">AClientNetwork</span></div>
    </dd>
  </dl>

  <dl class="typelist implements">
    <dt>实现</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    </dd>
  </dl>

  <dl class="typelist derived">
    <dt>Derived</dt>
    <dd>
      <div><a class="xref" href="Fantasy.Core.Network.KCPClientNetwork.html">KCPClientNetwork</a></div>
      <div><a class="xref" href="Fantasy.Core.Network.TCPClientNetwork.html">TCPClientNetwork</a></div>
    </dd>
  </dl>

  <dl class="typelist derived">
    <dt>继承成员</dt>
    <dd>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_Pack">ANetwork.Pack</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_Send_System_UInt32_System_UInt32_System_Int64_System_Int64_System_Object_">ANetwork.Send(uint, uint, long, long, object)</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_Send_System_UInt32_System_UInt32_System_Int64_System_Int64_System_IO_MemoryStream_">ANetwork.Send(uint, uint, long, long, MemoryStream)</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_RemoveChannel_System_UInt32_">ANetwork.RemoveChannel(uint)</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_Id">ANetwork.Id</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_Scene">ANetwork.Scene</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_IsDisposed">ANetwork.IsDisposed</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_NetworkType">ANetwork.NetworkType</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_NetworkTarget">ANetwork.NetworkTarget</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_NetworkProtocolType">ANetwork.NetworkProtocolType</a>
    </div>
    <div>
      <a class="xref" href="Fantasy.Core.Network.ANetwork.html#Fantasy_Core_Network_ANetwork_NetworkMessageScheduler">ANetwork.NetworkMessageScheduler</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
    </div>
  </dd></dl>

  <dl class="typelist extensionMethods">
    <dt>扩展方法</dt>
    <dd>
  <div>
      <a class="xref" href="Fantasy.Helper.JsonHelper.html#Fantasy_Helper_JsonHelper_ToJson__1___0_">JsonHelper.ToJson&lt;T&gt;(T)</a>
  </div>
  </dd></dl>





  <h2 class="section" id="constructors">构造函数
</h2>


  <a id="Fantasy_Core_Network_AClientNetwork__ctor_" data-uid="Fantasy.Core.Network.AClientNetwork.#ctor*"></a>

  <h3 id="Fantasy_Core_Network_AClientNetwork__ctor_Fantasy_Scene_Fantasy_Core_Network_NetworkType_Fantasy_Core_Network_NetworkProtocolType_Fantasy_Core_Network_NetworkTarget_" data-uid="Fantasy.Core.Network.AClientNetwork.#ctor(Fantasy.Scene,Fantasy.Core.Network.NetworkType,Fantasy.Core.Network.NetworkProtocolType,Fantasy.Core.Network.NetworkTarget)">
  AClientNetwork(Scene, NetworkType, NetworkProtocolType, NetworkTarget)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">protected AClientNetwork(Scene scene, NetworkType networkType, NetworkProtocolType networkProtocolType, NetworkTarget networkTarget)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>scene</code> <a class="xref" href="Fantasy.Scene.html">Scene</a></dt>
    <dd></dd>
    <dt><code>networkType</code> <a class="xref" href="Fantasy.Core.Network.NetworkType.html">NetworkType</a></dt>
    <dd></dd>
    <dt><code>networkProtocolType</code> <a class="xref" href="Fantasy.Core.Network.NetworkProtocolType.html">NetworkProtocolType</a></dt>
    <dd></dd>
    <dt><code>networkTarget</code> <a class="xref" href="Fantasy.Core.Network.NetworkTarget.html">NetworkTarget</a></dt>
    <dd></dd>
  </dl>












  <h2 class="section" id="properties">属性
</h2>


  <a id="Fantasy_Core_Network_AClientNetwork_ChannelId_" data-uid="Fantasy.Core.Network.AClientNetwork.ChannelId*"></a>

  <h3 id="Fantasy_Core_Network_AClientNetwork_ChannelId" data-uid="Fantasy.Core.Network.AClientNetwork.ChannelId">
  ChannelId
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public uint ChannelId { get; protected set; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a></dt>
    <dd></dd>
  </dl>








  <h2 class="section" id="methods">方法
</h2>


  <a id="Fantasy_Core_Network_AClientNetwork_Connect_" data-uid="Fantasy.Core.Network.AClientNetwork.Connect*"></a>

  <h3 id="Fantasy_Core_Network_AClientNetwork_Connect_System_Net_IPEndPoint_System_Action_System_Action_System_Action_System_Int32_" data-uid="Fantasy.Core.Network.AClientNetwork.Connect(System.Net.IPEndPoint,System.Action,System.Action,System.Action,System.Int32)">
  Connect(IPEndPoint, Action, Action, Action, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract uint Connect(IPEndPoint remoteEndPoint, Action onConnectComplete, Action onConnectFail, Action onConnectDisconnect, int connectTimeout = 5000)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>remoteEndPoint</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.net.ipendpoint">IPEndPoint</a></dt>
    <dd></dd>
    <dt><code>onConnectComplete</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
    <dd></dd>
    <dt><code>onConnectFail</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
    <dd></dd>
    <dt><code>onConnectDisconnect</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
    <dd></dd>
    <dt><code>connectTimeout</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_Core_Network_AClientNetwork_Dispose_" data-uid="Fantasy.Core.Network.AClientNetwork.Dispose*"></a>

  <h3 id="Fantasy_Core_Network_AClientNetwork_Dispose" data-uid="Fantasy.Core.Network.AClientNetwork.Dispose">
  Dispose()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void Dispose()</code></pre>
  </div>













  <h2 class="section" id="events">事件
</h2>



  <h3 id="Fantasy_Core_Network_AClientNetwork_OnChangeChannelId" data-uid="Fantasy.Core.Network.AClientNetwork.OnChangeChannelId">
  OnChangeChannelId
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract event Action&lt;uint&gt; OnChangeChannelId</code></pre>
  </div>






  <h4 class="section">事件类型</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a>&gt;</dt>
    <dd></dd>
  </dl>








  <h3 id="Fantasy_Core_Network_AClientNetwork_OnConnectComplete" data-uid="Fantasy.Core.Network.AClientNetwork.OnConnectComplete">
  OnConnectComplete
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract event Action OnConnectComplete</code></pre>
  </div>






  <h4 class="section">事件类型</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
    <dd></dd>
  </dl>








  <h3 id="Fantasy_Core_Network_AClientNetwork_OnConnectDisconnect" data-uid="Fantasy.Core.Network.AClientNetwork.OnConnectDisconnect">
  OnConnectDisconnect
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract event Action OnConnectDisconnect</code></pre>
  </div>






  <h4 class="section">事件类型</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
    <dd></dd>
  </dl>








  <h3 id="Fantasy_Core_Network_AClientNetwork_OnConnectFail" data-uid="Fantasy.Core.Network.AClientNetwork.OnConnectFail">
  OnConnectFail
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract event Action OnConnectFail</code></pre>
  </div>






  <h4 class="section">事件类型</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
    <dd></dd>
  </dl>








  <h3 id="Fantasy_Core_Network_AClientNetwork_OnDispose" data-uid="Fantasy.Core.Network.AClientNetwork.OnDispose">
  OnDispose
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract event Action OnDispose</code></pre>
  </div>






  <h4 class="section">事件类型</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></dt>
    <dd></dd>
  </dl>








  <h3 id="Fantasy_Core_Network_AClientNetwork_OnReceiveMemoryStream" data-uid="Fantasy.Core.Network.AClientNetwork.OnReceiveMemoryStream">
  OnReceiveMemoryStream
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract event Action&lt;APackInfo&gt; OnReceiveMemoryStream</code></pre>
  </div>






  <h4 class="section">事件类型</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="Fantasy.Core.Network.APackInfo.html">APackInfo</a>&gt;</dt>
    <dd></dd>
  </dl>








</article>


        
      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top">
      <div class="container-xxl">
        <div class="flex-fill">
          <span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
        </div>
      </div>
    </footer>
  </body>
</html>